/******************************************************************************* 
 *  Copyright 2007 Amazon Technologies, Inc.  
 *  Licensed under the Apache License, Version 2.0 (the "License"); 
 *  
 *  You may not use this file except in compliance with the License. 
 *  You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the 
 *  specific language governing permissions and limitations under the License.
 * ***************************************************************************** 
 *    __  _    _  ___ 
 *   (  )( \/\/ )/ __)
 *   /__\ \    / \__ \
 *  (_)(_) \/\/  (___/
 * 
 *  Amazon ECS CSharp Library
 *  API Version: 2007-07-16
 *  Generated: Thu Aug 02 10:15:38 PDT 2007 
 * 
 */

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Text;


namespace Amazon.ECS.Model
{
    [XmlTypeAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16")]
    [XmlRootAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16", IsNullable = false)]
    public class Item
    {
    
        private  AlternateVersions alternateVersionsField;
        private String ASINField;

        private String parentASINField;

        private String detailPageURLField;

        private String salesRankField;

        private  Image smallImageField;
        private  Image mediumImageField;
        private  Image largeImageField;
        private  List<ImageSets> imageSetsField;

        private  ItemAttributes itemAttributesField;
        private  MerchantItemAttributes merchantItemAttributesField;
        private  Collections collectionsField;
        private  Subjects subjectsField;
        private  OfferSummary offerSummaryField;
        private  Offers offersField;
        private  VariationSummary variationSummaryField;
        private  Variations variationsField;
        private  CustomerReviews customerReviewsField;
        private  EditorialReviews editorialReviewsField;
        private  SimilarProducts similarProductsField;
        private  Accessories accessoriesField;
        private  Tracks tracksField;
        private  BrowseNodes browseNodesField;
        private  SearchInside searchInsideField;
        private  ListmaniaLists listmaniaListsField;
        private  Tags tagsField;

        /// <summary>
        /// Gets and sets the AlternateVersions property.
        /// </summary>
        [XmlElementAttribute(ElementName = "AlternateVersions")]
        public AlternateVersions AlternateVersions
        {
            get { return this.alternateVersionsField ; }
            set { this.alternateVersionsField = value; }
        }



        /// <summary>
        /// Sets the AlternateVersions property
        /// </summary>
        /// <param name="alternateVersions">AlternateVersions property</param>
        /// <returns>this instance</returns>
        public Item WithAlternateVersions(AlternateVersions alternateVersions)
        {
            this.alternateVersionsField = alternateVersions;
            return this;
        }



        /// <summary>
        /// Checks if AlternateVersions property is set
        /// </summary>
        /// <returns>true if AlternateVersions property is set</returns>
        public Boolean IsSetAlternateVersions()
        {
            return this.alternateVersionsField != null;
        }




        /// <summary>
        /// Gets and sets the ASIN property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ASIN")]
        public String ASIN
        {
            get { return this.ASINField ; }
            set { this.ASINField= value; }
        }



        /// <summary>
        /// Sets the ASIN property
        /// </summary>
        /// <param name="ASIN">ASIN property</param>
        /// <returns>this instance</returns>
        public Item WithASIN(String ASIN)
        {
            this.ASINField = ASIN;
            return this;
        }



        /// <summary>
        /// Checks if ASIN property is set
        /// </summary>
        /// <returns>true if ASIN property is set</returns>
        public Boolean IsSetASIN()
        {
            return  this.ASINField != null;

        }


        /// <summary>
        /// Gets and sets the ParentASIN property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ParentASIN")]
        public String ParentASIN
        {
            get { return this.parentASINField ; }
            set { this.parentASINField= value; }
        }



        /// <summary>
        /// Sets the ParentASIN property
        /// </summary>
        /// <param name="parentASIN">ParentASIN property</param>
        /// <returns>this instance</returns>
        public Item WithParentASIN(String parentASIN)
        {
            this.parentASINField = parentASIN;
            return this;
        }



        /// <summary>
        /// Checks if ParentASIN property is set
        /// </summary>
        /// <returns>true if ParentASIN property is set</returns>
        public Boolean IsSetParentASIN()
        {
            return  this.parentASINField != null;

        }


        /// <summary>
        /// Gets and sets the DetailPageURL property.
        /// </summary>
        [XmlElementAttribute(ElementName = "DetailPageURL")]
        public String DetailPageURL
        {
            get { return this.detailPageURLField ; }
            set { this.detailPageURLField= value; }
        }



        /// <summary>
        /// Sets the DetailPageURL property
        /// </summary>
        /// <param name="detailPageURL">DetailPageURL property</param>
        /// <returns>this instance</returns>
        public Item WithDetailPageURL(String detailPageURL)
        {
            this.detailPageURLField = detailPageURL;
            return this;
        }



        /// <summary>
        /// Checks if DetailPageURL property is set
        /// </summary>
        /// <returns>true if DetailPageURL property is set</returns>
        public Boolean IsSetDetailPageURL()
        {
            return  this.detailPageURLField != null;

        }


        /// <summary>
        /// Gets and sets the SalesRank property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SalesRank")]
        public String SalesRank
        {
            get { return this.salesRankField ; }
            set { this.salesRankField= value; }
        }



        /// <summary>
        /// Sets the SalesRank property
        /// </summary>
        /// <param name="salesRank">SalesRank property</param>
        /// <returns>this instance</returns>
        public Item WithSalesRank(String salesRank)
        {
            this.salesRankField = salesRank;
            return this;
        }



        /// <summary>
        /// Checks if SalesRank property is set
        /// </summary>
        /// <returns>true if SalesRank property is set</returns>
        public Boolean IsSetSalesRank()
        {
            return  this.salesRankField != null;

        }


        /// <summary>
        /// Gets and sets the SmallImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SmallImage")]
        public Image SmallImage
        {
            get { return this.smallImageField ; }
            set { this.smallImageField = value; }
        }



        /// <summary>
        /// Sets the SmallImage property
        /// </summary>
        /// <param name="smallImage">SmallImage property</param>
        /// <returns>this instance</returns>
        public Item WithSmallImage(Image smallImage)
        {
            this.smallImageField = smallImage;
            return this;
        }



        /// <summary>
        /// Checks if SmallImage property is set
        /// </summary>
        /// <returns>true if SmallImage property is set</returns>
        public Boolean IsSetSmallImage()
        {
            return this.smallImageField != null;
        }




        /// <summary>
        /// Gets and sets the MediumImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "MediumImage")]
        public Image MediumImage
        {
            get { return this.mediumImageField ; }
            set { this.mediumImageField = value; }
        }



        /// <summary>
        /// Sets the MediumImage property
        /// </summary>
        /// <param name="mediumImage">MediumImage property</param>
        /// <returns>this instance</returns>
        public Item WithMediumImage(Image mediumImage)
        {
            this.mediumImageField = mediumImage;
            return this;
        }



        /// <summary>
        /// Checks if MediumImage property is set
        /// </summary>
        /// <returns>true if MediumImage property is set</returns>
        public Boolean IsSetMediumImage()
        {
            return this.mediumImageField != null;
        }




        /// <summary>
        /// Gets and sets the LargeImage property.
        /// </summary>
        [XmlElementAttribute(ElementName = "LargeImage")]
        public Image LargeImage
        {
            get { return this.largeImageField ; }
            set { this.largeImageField = value; }
        }



        /// <summary>
        /// Sets the LargeImage property
        /// </summary>
        /// <param name="largeImage">LargeImage property</param>
        /// <returns>this instance</returns>
        public Item WithLargeImage(Image largeImage)
        {
            this.largeImageField = largeImage;
            return this;
        }



        /// <summary>
        /// Checks if LargeImage property is set
        /// </summary>
        /// <returns>true if LargeImage property is set</returns>
        public Boolean IsSetLargeImage()
        {
            return this.largeImageField != null;
        }




        /// <summary>
        /// Gets and sets the ImageSets property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ImageSets")]
        public List<ImageSets> ImageSets
        {
            get
            {
                if (this.imageSetsField == null)
                {
                    this.imageSetsField = new List<ImageSets>();
                }
                return this.imageSetsField;
            }
            set { this.imageSetsField =  value; }
        }



        /// <summary>
        /// Sets the ImageSets property
        /// </summary>
        /// <param name="list">ImageSets property</param>
        /// <returns>this instance</returns>
        public Item WithImageSets(params ImageSets[] list)
        {
            foreach (ImageSets item in list)
            {
                ImageSets.Add(item);
            }
            return this;
        }          
 


        /// <summary>
        /// Checks if ImageSets property is set
        /// </summary>
        /// <returns>true if ImageSets property is set</returns>
        public Boolean IsSetImageSets()
        {
            return (ImageSets.Count > 0);
        }


        /// <summary>
        /// Gets and sets the ItemAttributes property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ItemAttributes")]
        public ItemAttributes ItemAttributes
        {
            get { return this.itemAttributesField ; }
            set { this.itemAttributesField = value; }
        }



        /// <summary>
        /// Sets the ItemAttributes property
        /// </summary>
        /// <param name="itemAttributes">ItemAttributes property</param>
        /// <returns>this instance</returns>
        public Item WithItemAttributes(ItemAttributes itemAttributes)
        {
            this.itemAttributesField = itemAttributes;
            return this;
        }



        /// <summary>
        /// Checks if ItemAttributes property is set
        /// </summary>
        /// <returns>true if ItemAttributes property is set</returns>
        public Boolean IsSetItemAttributes()
        {
            return this.itemAttributesField != null;
        }




        /// <summary>
        /// Gets and sets the MerchantItemAttributes property.
        /// </summary>
        [XmlElementAttribute(ElementName = "MerchantItemAttributes")]
        public MerchantItemAttributes MerchantItemAttributes
        {
            get { return this.merchantItemAttributesField ; }
            set { this.merchantItemAttributesField = value; }
        }



        /// <summary>
        /// Sets the MerchantItemAttributes property
        /// </summary>
        /// <param name="merchantItemAttributes">MerchantItemAttributes property</param>
        /// <returns>this instance</returns>
        public Item WithMerchantItemAttributes(MerchantItemAttributes merchantItemAttributes)
        {
            this.merchantItemAttributesField = merchantItemAttributes;
            return this;
        }



        /// <summary>
        /// Checks if MerchantItemAttributes property is set
        /// </summary>
        /// <returns>true if MerchantItemAttributes property is set</returns>
        public Boolean IsSetMerchantItemAttributes()
        {
            return this.merchantItemAttributesField != null;
        }




        /// <summary>
        /// Gets and sets the Collections property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Collections")]
        public Collections Collections
        {
            get { return this.collectionsField ; }
            set { this.collectionsField = value; }
        }



        /// <summary>
        /// Sets the Collections property
        /// </summary>
        /// <param name="collections">Collections property</param>
        /// <returns>this instance</returns>
        public Item WithCollections(Collections collections)
        {
            this.collectionsField = collections;
            return this;
        }



        /// <summary>
        /// Checks if Collections property is set
        /// </summary>
        /// <returns>true if Collections property is set</returns>
        public Boolean IsSetCollections()
        {
            return this.collectionsField != null;
        }




        /// <summary>
        /// Gets and sets the Subjects property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Subjects")]
        public Subjects Subjects
        {
            get { return this.subjectsField ; }
            set { this.subjectsField = value; }
        }



        /// <summary>
        /// Sets the Subjects property
        /// </summary>
        /// <param name="subjects">Subjects property</param>
        /// <returns>this instance</returns>
        public Item WithSubjects(Subjects subjects)
        {
            this.subjectsField = subjects;
            return this;
        }



        /// <summary>
        /// Checks if Subjects property is set
        /// </summary>
        /// <returns>true if Subjects property is set</returns>
        public Boolean IsSetSubjects()
        {
            return this.subjectsField != null;
        }




        /// <summary>
        /// Gets and sets the OfferSummary property.
        /// </summary>
        [XmlElementAttribute(ElementName = "OfferSummary")]
        public OfferSummary OfferSummary
        {
            get { return this.offerSummaryField ; }
            set { this.offerSummaryField = value; }
        }



        /// <summary>
        /// Sets the OfferSummary property
        /// </summary>
        /// <param name="offerSummary">OfferSummary property</param>
        /// <returns>this instance</returns>
        public Item WithOfferSummary(OfferSummary offerSummary)
        {
            this.offerSummaryField = offerSummary;
            return this;
        }



        /// <summary>
        /// Checks if OfferSummary property is set
        /// </summary>
        /// <returns>true if OfferSummary property is set</returns>
        public Boolean IsSetOfferSummary()
        {
            return this.offerSummaryField != null;
        }




        /// <summary>
        /// Gets and sets the Offers property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Offers")]
        public Offers Offers
        {
            get { return this.offersField ; }
            set { this.offersField = value; }
        }



        /// <summary>
        /// Sets the Offers property
        /// </summary>
        /// <param name="offers">Offers property</param>
        /// <returns>this instance</returns>
        public Item WithOffers(Offers offers)
        {
            this.offersField = offers;
            return this;
        }



        /// <summary>
        /// Checks if Offers property is set
        /// </summary>
        /// <returns>true if Offers property is set</returns>
        public Boolean IsSetOffers()
        {
            return this.offersField != null;
        }




        /// <summary>
        /// Gets and sets the VariationSummary property.
        /// </summary>
        [XmlElementAttribute(ElementName = "VariationSummary")]
        public VariationSummary VariationSummary
        {
            get { return this.variationSummaryField ; }
            set { this.variationSummaryField = value; }
        }



        /// <summary>
        /// Sets the VariationSummary property
        /// </summary>
        /// <param name="variationSummary">VariationSummary property</param>
        /// <returns>this instance</returns>
        public Item WithVariationSummary(VariationSummary variationSummary)
        {
            this.variationSummaryField = variationSummary;
            return this;
        }



        /// <summary>
        /// Checks if VariationSummary property is set
        /// </summary>
        /// <returns>true if VariationSummary property is set</returns>
        public Boolean IsSetVariationSummary()
        {
            return this.variationSummaryField != null;
        }




        /// <summary>
        /// Gets and sets the Variations property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Variations")]
        public Variations Variations
        {
            get { return this.variationsField ; }
            set { this.variationsField = value; }
        }



        /// <summary>
        /// Sets the Variations property
        /// </summary>
        /// <param name="variations">Variations property</param>
        /// <returns>this instance</returns>
        public Item WithVariations(Variations variations)
        {
            this.variationsField = variations;
            return this;
        }



        /// <summary>
        /// Checks if Variations property is set
        /// </summary>
        /// <returns>true if Variations property is set</returns>
        public Boolean IsSetVariations()
        {
            return this.variationsField != null;
        }




        /// <summary>
        /// Gets and sets the CustomerReviews property.
        /// </summary>
        [XmlElementAttribute(ElementName = "CustomerReviews")]
        public CustomerReviews CustomerReviews
        {
            get { return this.customerReviewsField ; }
            set { this.customerReviewsField = value; }
        }



        /// <summary>
        /// Sets the CustomerReviews property
        /// </summary>
        /// <param name="customerReviews">CustomerReviews property</param>
        /// <returns>this instance</returns>
        public Item WithCustomerReviews(CustomerReviews customerReviews)
        {
            this.customerReviewsField = customerReviews;
            return this;
        }



        /// <summary>
        /// Checks if CustomerReviews property is set
        /// </summary>
        /// <returns>true if CustomerReviews property is set</returns>
        public Boolean IsSetCustomerReviews()
        {
            return this.customerReviewsField != null;
        }




        /// <summary>
        /// Gets and sets the EditorialReviews property.
        /// </summary>
        [XmlElementAttribute(ElementName = "EditorialReviews")]
        public EditorialReviews EditorialReviews
        {
            get { return this.editorialReviewsField ; }
            set { this.editorialReviewsField = value; }
        }



        /// <summary>
        /// Sets the EditorialReviews property
        /// </summary>
        /// <param name="editorialReviews">EditorialReviews property</param>
        /// <returns>this instance</returns>
        public Item WithEditorialReviews(EditorialReviews editorialReviews)
        {
            this.editorialReviewsField = editorialReviews;
            return this;
        }



        /// <summary>
        /// Checks if EditorialReviews property is set
        /// </summary>
        /// <returns>true if EditorialReviews property is set</returns>
        public Boolean IsSetEditorialReviews()
        {
            return this.editorialReviewsField != null;
        }




        /// <summary>
        /// Gets and sets the SimilarProducts property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SimilarProducts")]
        public SimilarProducts SimilarProducts
        {
            get { return this.similarProductsField ; }
            set { this.similarProductsField = value; }
        }



        /// <summary>
        /// Sets the SimilarProducts property
        /// </summary>
        /// <param name="similarProducts">SimilarProducts property</param>
        /// <returns>this instance</returns>
        public Item WithSimilarProducts(SimilarProducts similarProducts)
        {
            this.similarProductsField = similarProducts;
            return this;
        }



        /// <summary>
        /// Checks if SimilarProducts property is set
        /// </summary>
        /// <returns>true if SimilarProducts property is set</returns>
        public Boolean IsSetSimilarProducts()
        {
            return this.similarProductsField != null;
        }




        /// <summary>
        /// Gets and sets the Accessories property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Accessories")]
        public Accessories Accessories
        {
            get { return this.accessoriesField ; }
            set { this.accessoriesField = value; }
        }



        /// <summary>
        /// Sets the Accessories property
        /// </summary>
        /// <param name="accessories">Accessories property</param>
        /// <returns>this instance</returns>
        public Item WithAccessories(Accessories accessories)
        {
            this.accessoriesField = accessories;
            return this;
        }



        /// <summary>
        /// Checks if Accessories property is set
        /// </summary>
        /// <returns>true if Accessories property is set</returns>
        public Boolean IsSetAccessories()
        {
            return this.accessoriesField != null;
        }




        /// <summary>
        /// Gets and sets the Tracks property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Tracks")]
        public Tracks Tracks
        {
            get { return this.tracksField ; }
            set { this.tracksField = value; }
        }



        /// <summary>
        /// Sets the Tracks property
        /// </summary>
        /// <param name="tracks">Tracks property</param>
        /// <returns>this instance</returns>
        public Item WithTracks(Tracks tracks)
        {
            this.tracksField = tracks;
            return this;
        }



        /// <summary>
        /// Checks if Tracks property is set
        /// </summary>
        /// <returns>true if Tracks property is set</returns>
        public Boolean IsSetTracks()
        {
            return this.tracksField != null;
        }




        /// <summary>
        /// Gets and sets the BrowseNodes property.
        /// </summary>
        [XmlElementAttribute(ElementName = "BrowseNodes")]
        public BrowseNodes BrowseNodes
        {
            get { return this.browseNodesField ; }
            set { this.browseNodesField = value; }
        }



        /// <summary>
        /// Sets the BrowseNodes property
        /// </summary>
        /// <param name="browseNodes">BrowseNodes property</param>
        /// <returns>this instance</returns>
        public Item WithBrowseNodes(BrowseNodes browseNodes)
        {
            this.browseNodesField = browseNodes;
            return this;
        }



        /// <summary>
        /// Checks if BrowseNodes property is set
        /// </summary>
        /// <returns>true if BrowseNodes property is set</returns>
        public Boolean IsSetBrowseNodes()
        {
            return this.browseNodesField != null;
        }




        /// <summary>
        /// Gets and sets the SearchInside property.
        /// </summary>
        [XmlElementAttribute(ElementName = "SearchInside")]
        public SearchInside SearchInside
        {
            get { return this.searchInsideField ; }
            set { this.searchInsideField = value; }
        }



        /// <summary>
        /// Sets the SearchInside property
        /// </summary>
        /// <param name="searchInside">SearchInside property</param>
        /// <returns>this instance</returns>
        public Item WithSearchInside(SearchInside searchInside)
        {
            this.searchInsideField = searchInside;
            return this;
        }



        /// <summary>
        /// Checks if SearchInside property is set
        /// </summary>
        /// <returns>true if SearchInside property is set</returns>
        public Boolean IsSetSearchInside()
        {
            return this.searchInsideField != null;
        }




        /// <summary>
        /// Gets and sets the ListmaniaLists property.
        /// </summary>
        [XmlElementAttribute(ElementName = "ListmaniaLists")]
        public ListmaniaLists ListmaniaLists
        {
            get { return this.listmaniaListsField ; }
            set { this.listmaniaListsField = value; }
        }



        /// <summary>
        /// Sets the ListmaniaLists property
        /// </summary>
        /// <param name="listmaniaLists">ListmaniaLists property</param>
        /// <returns>this instance</returns>
        public Item WithListmaniaLists(ListmaniaLists listmaniaLists)
        {
            this.listmaniaListsField = listmaniaLists;
            return this;
        }



        /// <summary>
        /// Checks if ListmaniaLists property is set
        /// </summary>
        /// <returns>true if ListmaniaLists property is set</returns>
        public Boolean IsSetListmaniaLists()
        {
            return this.listmaniaListsField != null;
        }




        /// <summary>
        /// Gets and sets the Tags property.
        /// </summary>
        [XmlElementAttribute(ElementName = "Tags")]
        public Tags Tags
        {
            get { return this.tagsField ; }
            set { this.tagsField = value; }
        }



        /// <summary>
        /// Sets the Tags property
        /// </summary>
        /// <param name="tags">Tags property</param>
        /// <returns>this instance</returns>
        public Item WithTags(Tags tags)
        {
            this.tagsField = tags;
            return this;
        }



        /// <summary>
        /// Checks if Tags property is set
        /// </summary>
        /// <returns>true if Tags property is set</returns>
        public Boolean IsSetTags()
        {
            return this.tagsField != null;
        }






        /// <summary>
        /// XML fragment representation of this object
        /// </summary>
        /// <returns>XML fragment for this object.</returns>
        /// <remarks>
        /// Name for outer tag expected to be set by calling method. 
        /// This fragment returns inner properties representation only
        /// </remarks>


        protected internal String ToXMLFragment() {
            StringBuilder xml = new StringBuilder();
            if (IsSetAlternateVersions()) {
                AlternateVersions  alternateVersions = this.AlternateVersions;
                xml.Append("<AlternateVersions>");
                xml.Append(alternateVersions.ToXMLFragment());
                xml.Append("</AlternateVersions>");
            } 
            if (IsSetASIN()) {
                xml.Append("<ASIN>");
                xml.Append(EscapeXML(this.ASIN));
                xml.Append("</ASIN>");
            }
            if (IsSetParentASIN()) {
                xml.Append("<ParentASIN>");
                xml.Append(EscapeXML(this.ParentASIN));
                xml.Append("</ParentASIN>");
            }
            if (IsSetDetailPageURL()) {
                xml.Append("<DetailPageURL>");
                xml.Append(EscapeXML(this.DetailPageURL));
                xml.Append("</DetailPageURL>");
            }
            if (IsSetSalesRank()) {
                xml.Append("<SalesRank>");
                xml.Append(EscapeXML(this.SalesRank));
                xml.Append("</SalesRank>");
            }
            if (IsSetSmallImage()) {
                Image  smallImage = this.SmallImage;
                xml.Append("<SmallImage>");
                xml.Append(smallImage.ToXMLFragment());
                xml.Append("</SmallImage>");
            } 
            if (IsSetMediumImage()) {
                Image  mediumImage = this.MediumImage;
                xml.Append("<MediumImage>");
                xml.Append(mediumImage.ToXMLFragment());
                xml.Append("</MediumImage>");
            } 
            if (IsSetLargeImage()) {
                Image  largeImage = this.LargeImage;
                xml.Append("<LargeImage>");
                xml.Append(largeImage.ToXMLFragment());
                xml.Append("</LargeImage>");
            } 
            List<ImageSets> imageSetsList = this.ImageSets;
            foreach (ImageSets imageSets in imageSetsList) {
                xml.Append("<ImageSets>");
                xml.Append(imageSets.ToXMLFragment());
                xml.Append("</ImageSets>");
            }
            if (IsSetItemAttributes()) {
                ItemAttributes  itemAttributes = this.ItemAttributes;
                xml.Append("<ItemAttributes>");
                xml.Append(itemAttributes.ToXMLFragment());
                xml.Append("</ItemAttributes>");
            } 
            if (IsSetMerchantItemAttributes()) {
                MerchantItemAttributes  merchantItemAttributes = this.MerchantItemAttributes;
                xml.Append("<MerchantItemAttributes>");
                xml.Append(merchantItemAttributes.ToXMLFragment());
                xml.Append("</MerchantItemAttributes>");
            } 
            if (IsSetCollections()) {
                Collections  collections = this.Collections;
                xml.Append("<Collections>");
                xml.Append(collections.ToXMLFragment());
                xml.Append("</Collections>");
            } 
            if (IsSetSubjects()) {
                Subjects  subjects = this.Subjects;
                xml.Append("<Subjects>");
                xml.Append(subjects.ToXMLFragment());
                xml.Append("</Subjects>");
            } 
            if (IsSetOfferSummary()) {
                OfferSummary  offerSummary = this.OfferSummary;
                xml.Append("<OfferSummary>");
                xml.Append(offerSummary.ToXMLFragment());
                xml.Append("</OfferSummary>");
            } 
            if (IsSetOffers()) {
                Offers  offers = this.Offers;
                xml.Append("<Offers>");
                xml.Append(offers.ToXMLFragment());
                xml.Append("</Offers>");
            } 
            if (IsSetVariationSummary()) {
                VariationSummary  variationSummary = this.VariationSummary;
                xml.Append("<VariationSummary>");
                xml.Append(variationSummary.ToXMLFragment());
                xml.Append("</VariationSummary>");
            } 
            if (IsSetVariations()) {
                Variations  variations = this.Variations;
                xml.Append("<Variations>");
                xml.Append(variations.ToXMLFragment());
                xml.Append("</Variations>");
            } 
            if (IsSetCustomerReviews()) {
                CustomerReviews  customerReviews = this.CustomerReviews;
                xml.Append("<CustomerReviews>");
                xml.Append(customerReviews.ToXMLFragment());
                xml.Append("</CustomerReviews>");
            } 
            if (IsSetEditorialReviews()) {
                EditorialReviews  editorialReviews = this.EditorialReviews;
                xml.Append("<EditorialReviews>");
                xml.Append(editorialReviews.ToXMLFragment());
                xml.Append("</EditorialReviews>");
            } 
            if (IsSetSimilarProducts()) {
                SimilarProducts  similarProducts = this.SimilarProducts;
                xml.Append("<SimilarProducts>");
                xml.Append(similarProducts.ToXMLFragment());
                xml.Append("</SimilarProducts>");
            } 
            if (IsSetAccessories()) {
                Accessories  accessories = this.Accessories;
                xml.Append("<Accessories>");
                xml.Append(accessories.ToXMLFragment());
                xml.Append("</Accessories>");
            } 
            if (IsSetTracks()) {
                Tracks  tracks = this.Tracks;
                xml.Append("<Tracks>");
                xml.Append(tracks.ToXMLFragment());
                xml.Append("</Tracks>");
            } 
            if (IsSetBrowseNodes()) {
                BrowseNodes  browseNodes = this.BrowseNodes;
                xml.Append("<BrowseNodes>");
                xml.Append(browseNodes.ToXMLFragment());
                xml.Append("</BrowseNodes>");
            } 
            if (IsSetSearchInside()) {
                SearchInside  searchInside = this.SearchInside;
                xml.Append("<SearchInside>");
                xml.Append(searchInside.ToXMLFragment());
                xml.Append("</SearchInside>");
            } 
            if (IsSetListmaniaLists()) {
                ListmaniaLists  listmaniaLists = this.ListmaniaLists;
                xml.Append("<ListmaniaLists>");
                xml.Append(listmaniaLists.ToXMLFragment());
                xml.Append("</ListmaniaLists>");
            } 
            if (IsSetTags()) {
                Tags  tags = this.Tags;
                xml.Append("<Tags>");
                xml.Append(tags.ToXMLFragment());
                xml.Append("</Tags>");
            } 
            return xml.ToString();
        }

        /**
         * 
         * Escape XML special characters
         */
        private String EscapeXML(String str) {
            StringBuilder sb = new StringBuilder();
            foreach (Char c in str)
            {
                switch (c) {
                case '&':
                    sb.Append("&amp;");
                    break;
                case '<':
                    sb.Append("&lt;");
                    break;
                case '>':
                    sb.Append("&gt;");
                    break;
                case '\'':
                    sb.Append("&#039;");
                    break;
                case '"':
                    sb.Append("&quot;");
                    break;
                default:
                    sb.Append(c);
                    break;
                }
            }
            return sb.ToString();
        }




    }

}